BASS_ChannelGetLevel

Retrieves the level of a stream, or MOD music channel.

DWORD WINAPI BASS_ChannelGetLevel(
    DWORD handle
);

Parameters
handleThe channel handle... a HMUSIC, HSTREAM.

Return value
If an error occurs, 0xFFFFFFFF is returned, use BASS_ErrorGetCode to get the error code. If successful, the level of the left channel is returned in the low word (low 16 bits), and the level of the right channel is returned in the high word (high 16 bits). If the channel is mono, then the high word is 0. The level ranges linearly from 0 (silent) to 128 (max).

Error codes
BASS_ERROR_HANDLEhandle is not a valid channel.

Remarks
The channel's volume (as set with BASS_ChannelSetAttributes) does not affect the value returned by this function... it measures the level of the channel's sample data and not the level of the channel in the final output mix.

Example
To get the left and right levels of a stereo channel.

DWORD level,left,right;
level=BASS_ChannelGetLevel(a_channel);
left=LOWORD(level); // the left level
right=HIWORD(level); // the right level

See also
BASS_ChannelIsActive